#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QInputDialog>
#include <QDebug>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    int result = QInputDialog::getInt(this,"整形输入框","请输入一个整形数字");
    qDebug() << result;
}

void MainWindow::on_pushButton_2_clicked()
{
    double result = QInputDialog::getDouble(this,"浮点数输入框","请输入一个浮点数");
    qDebug() << result;
}

void MainWindow::on_pushButton_3_clicked()
{
    QStringList items;
    items.push_back("煮豆燃豆萁");
    items.push_back("豆在釜中泣");
    items.push_back("本是同根生");
    items.push_back("相煎何太急");
    const QString &item = QInputDialog::getItem(this,"条目输入框","请输入一个条目",items,2);
    qDebug() << item;

}
